Introduction

Within the context of recent economic growth within the City of Buffalo (before Covid-19), this project will examine changes in Single Family Housing Prices from 2017 - 2020. Buffalo has experienced rising real estate values in response to economic development projects, university expansions and workforce development programs. This project will compare changes in housing prices across neighborhoods and investigate possible factors that influence housing prices such as number of bathrooms, bedrooms and total living area.

Materials and methods

Sources: Open Data Buffalo, Tax Assessment Data 2017 - 2020 Open Data Buffalo, Neighborhood Boundary Shapefile

Packages

library(tidyverse)
library(ggplot2)
library(ggmap)
library(maptools)
library(ggthemes)
library(rgeos)
library(broom)
library(plyr)
library(dplyr)
library(grid)
library(gridExtra)
library(reshape2)
library(scales)
library(sp)
library(sf)
library(rgdal)
library(RColorBrewer)
library(kableExtra)
library(leaflet)
knitr::opts_chunk$set(cache=TRUE) 

Data Download & Cleaning

# 2017 - 2019 Buffalo Assessment Roll
Parcel17 <- read.csv(file = "https://raw.githubusercontent.com/geo511-2020/geo511-2020-project-erikwoyc/master/2017-2018_Assessment_Roll.csv")
SingleFam_propclass <- c("210", "215", "240", "241", "250", "270")
Buffalo_17 <- filter(Parcel17, PROPERTY.CLASS %in% SingleFam_propclass)

# 2019 - 2020 Buffalo Assessment Roll
Parcel20 <- read.csv(file = "https://raw.githubusercontent.com/geo511-2020/geo511-2020-project-erikwoyc/master/2019-2020_Assessment_Roll.csv")
SingleFam_propclass <- c("210", "215", "240", "241", "250", "270")
Buffalo_20 <- filter(Parcel20, PROPERTY.CLASS %in% SingleFam_propclass)

# Neighborhood Shapefile
Neighborhood_URL <- "https://data.buffalony.gov/api/geospatial/q9bk-zu3p?method=export&format=GeoJSON"
Buffalo_Neighborhoods <- st_read(dsn = Neighborhood_URL)
Buffalo_sp <- as_Spatial(Buffalo_Neighborhoods)

#Snapshot of Assessment Data from 2017 - 2018

Parcel17 %>% 
  slice(1:10) %>% 
  kable(digits=2,align="c") %>% 
  kable_styling(bootstrap_options = 
                  c("striped", "hover", "condensed", "responsive")) 
SBL TAX.DISTRICT PRINT.KEY FRONT DEPTH PROPERTY.CLASS PROP.CLASS.DESCRIPTION PREVIOUS.PROPERTY.CLASS OWNER1 OWNER2 MAIL1 MAIL2 MAIL3 MAIL4 HOUSE.NUMBER STREET ADDRESS CITY STATE ZIP.CODE..5.DIGIT. ZIP.CODE..4.DIGIT. DEED.BOOK DEED.PAGE DEED.DATE ROLL.SECTION LAND.VALUE TOTAL.VALUE SALE.PRICE YEAR.BUILT TOTAL.LIVING.AREA OVERALL.CONDITION BUILDING.STYLE HEAT.TYPE BASEMENT.TYPE X..OF.FIREPLACES X..OF.BEDS X..OF.BATHS COUNCIL.DISTRICT POLICE.DISTRICT CENSUS.TRACT CENSUS.BLOCK.GROUP CENSUS.BLOCK NEIGHBORHOOD LATITUDE LONGITUDE LOCATION
1.12e+15 147012 112.10-2-3 45.00 0 710 MANUFACTURING & PROCESSING 710 MEGTEX, INC. 140 NORTH ST BUFFALO, NY 160 BUD MILL 160 BUD MILL BUFFALO NY 14206 NA 11132 2524 7/23/2007 1 202600 825000 285664 NA 0 NA NA NA NA 0 0 0.0 NA NA
NA 147013 132.08-1-6./A 287.00 400 350 URBAN RENEWAL VACANT LAND 350 FORT SCHUYLER MANAGEMENT CORPORATION 257 FULLER RD ALBANY, NY 2 BUFFALO RR SOUTH 2 BUFFALO RR SOUTH BUFFALO NY NA NA 11272 3307 9/9/9999 8 6900 6900 0 NA 0 NA NA NA NA 0 0 0.0 NA NA
8.93e+14 147010 89.28-4-1 283.28 0 841 MOTOR VEHICLE 841 N.F.T.A. PO BOX 5008 BUFFALO, NY 2646 MAIN 2646 MAIN BUFFALO NY 14214 NA 7475 493 9/9/9999 8 77700 22440000 0 NA 0 NA NA NA NA 0 0 0.0 MASTEN District D 40.01 5 5001 Parkside 42.94 -78.84 (42.93973696004812, -78.83864068992023)
9.04e+14 147010 90.37-3-31 30.00 5 311 RESIDENTIAL VACANT LAND 311 CITY OF BUFFALO PERFECTING TITLE 192 VICTORIA BUFFALO, NY 99999 VICTORIA 99999 VICTORIA BUFFALO NY 14214 NA 7669 643 9/9/9999 8 400 400 0 NA 0 NA NA NA NA 0 0 0.0 NA NA
1.00e+15 147006 100.24-3-41 33.00 90 220 TWO FAMILY DWELLING 220 MP DEVELOPMENT LLC 31 HARVARD BUFFALO, NY 31 HARVARD 31 HARVARD BUFFALO NY 14209 NA 11274 2943 11/14/2014 1 3000 54500 45780 1918 2302 3 8 2 4 0 6 2.0 ELLICOTT District D 169 3 3000 Elmwood Bidwell 42.92 -78.86 (42.91848032397568, -78.86218043101054)
1.00e+15 147007 100.21-3-13 41.00 174 482 DOWNTOWN ROW TYPE (DETACHED) 482 MILLAFORD VENTURES LLC 818 ELMWOOD AVE FRNT RIGHT BUFFALO, NY 818 ELMWOOD 818 ELMWOOD BUFFALO NY 14222 NA 11268 4784 8/19/2014 1 17900 275000 1 NA 0 NA NA NA NA 0 0 0.0 DELAWARE District D 65.01 1 1000 Elmwood Bidwell 42.92 -78.88 (42.9194355694349, -78.87709280994117)
1.00e+15 147006 100.24-3-24 37.00 199 482 DOWNTOWN ROW TYPE (DETACHED) 482 SILVER LEONARD 1762 MAIN ST BUFFALO, NY 1766 MAIN 1766 MAIN BUFFALO NY 14209 NA 9080 155 9/9/9999 1 18400 34500 0 NA 0 NA NA NA NA 0 0 0.0 ELLICOTT District D 169 3 3000 Elmwood Bidwell 42.92 -78.86 (42.920238159038476, -78.85944723608432)
1.00e+15 147006 100.22-2-70 33.00 113 210 ONE FAMILY DWELLING 210 MCLOUGHLIN AUSTIN P MURRAY MARY ELIZABETH 706 AUBURN AVE BUFFALO, NY 706 AUBURN 706 AUBURN BUFFALO NY 14222 NA 11058 2073 10/2/2003 1 30700 210000 182000 1910 2106 3 8 2 4 1 4 2.1 DELAWARE District D 169 1 1002 Elmwood Bidwell 42.92 -78.87 (42.918710564992416, -78.87441389506147)
1.00e+15 147007 100.21-4-8.21 41.00 143 482 DOWNTOWN ROW TYPE (DETACHED) 482 GPK LLC 44 LONGLEAT PKWY SNYDER, NY 758 ELMWOOD 758 ELMWOOD BUFFALO NY 14222 NA 10998 2848 9/9/9999 1 21400 407500 0 NA 0 NA NA NA NA 0 0 0.0 DELAWARE District D 65.01 1 1005 Elmwood Bidwell 42.92 -78.88 (42.91772431790134, -78.87710775061227)
1.00e+15 147007 100.21-3-9 35.00 86 220 TWO FAMILY DWELLING 220 REED BARBARA ANN 834 ELMWOOD BUFFALO, NY 834 ELMWOOD 834 ELMWOOD BUFFALO NY 14222 NA 9862 112 9/9/9999 1 22300 110000 0 1900 2076 3 8 2 4 0 5 2.0 DELAWARE District D 65.01 1 1000 Elmwood Bidwell 42.92 -78.88 (42.9198347309033, -78.87709262249685)

Data Exploration

# 2017 - 2018 Single Family Housing Price Histogram
Plot_2017 <- ggplot(data = Buffalo_17, mapping = aes(x = TOTAL.VALUE)) + 
  geom_histogram() + xlab("Total Property Value($)") + ylab("Count") +
  scale_fill_manual(values="lightblue") + theme_few() +
  labs(x="Total Value($)", y="Count", title="Distribution of Buffalo Home Prices",
       subtitle="Single Family Property Prices (2017 - 2018)", 
       caption="Source: Buffalo Open Data") + scale_x_continuous() + scale_y_continuous()
plot(Plot_2017)

# 2019 - 2020 Single Family Housing Price Histogram
Plot_2019 <- ggplot(data = Buffalo_20, mapping = aes(x = TOTAL.VALUE)) + 
  geom_histogram() + xlab("Total Property Value($)") + ylab("Count") +
  scale_fill_manual(values="lightblue") + theme_few() +
  labs(x="Total Value($)", y="Count", title="Distribution of Buffalo Home Prices",
       subtitle="Single Family Property Prices (2019 - 2020)", 
       caption="Source: Buffalo Open Data") + scale_x_continuous() + scale_y_continuous()
plot(Plot_2019)

Buffalo Base Map

#Buffalo Bounding Box
Buffalo_bbox <- Buffalo_sp@bbox

# Download the basemap
basemap <- get_stamenmap(
  bbox = Buffalo_bbox,
  zoom = 13,
  maptype = "toner-lite")

# View Map
BFMap <- ggmap(basemap) + 
  labs(title="Buffalo Basemap")
BFMap

2017 - 2018 Assessment Roll Plot

SingleFam17 <- ggmap(basemap) +
  geom_point(data = Buffalo_17, aes(x = LONGITUDE, y = LATITUDE, color = TOTAL.VALUE), 
             size = .025, alpha = 0.7) +
  scale_color_gradient("Single Family Home Price", low = "light green", high = "dark green", trans="log",
                       labels = scales::dollar_format(prefix = "$")) +
  labs(title="Distribution of Buffalo Home Prices",
       subtitle="Property Prices (2017 - 2018)",
       caption="Open Data Buffalo")
SingleFam17

2019 - 2020 Assessment Roll Plot

SingleFam20 <- ggmap(basemap) + 
  geom_point(data = Buffalo_20, aes(x = LONGITUDE, y = LATITUDE, color = TOTAL.VALUE), 
             size = .025, alpha = 0.7) +
  scale_color_gradient("Single Family Home Price", low = "light green", high = "dark green", trans="log",
                       labels = scales::dollar_format(prefix = "$")) +
  labs(title="Distribution of Buffalo Home Prices",
       subtitle="Property Prices (2019 - 2020)",
       caption="Open Data Buffalo")
SingleFam20

Interactive Map of Single Family Home Prices 2017 - 2020

#Color Pallette
pallete <- colorNumeric("viridis", NULL)

Neighborhood_map <- leaflet() %>%
  setMaxBounds(lng1 = -78.91246, lat1 = 42.82603, lng2 = -78.79504, lat2 = 42.96641) %>%
  addProviderTiles("CartoDB") %>%
  addProviderTiles("Stamen.TonerLines",
                   options = providerTileOptions(opacity = 0.35)) %>%
  addCircles(data = Buffalo_17, lng = Buffalo_17$LONGITUDE, lat = Buffalo_17$LATITUDE, 
             color = ~pallete(log(Buffalo_17$TOTAL.VALUE)),
             radius = .05, opacity = 0.5,
             group = "2017 - 2018") %>%
  addCircles(data = Buffalo_20, lng = Buffalo_20$LONGITUDE, lat = Buffalo_20$LATITUDE, 
             color = ~pallete(log(Buffalo_20$TOTAL.VALUE)),
             radius = .05, opacity = 0.5,
             group = "2019 - 2020")  %>%
  addPolygons(data = Buffalo_sp, fillColor = "transparent", color = "#444444", weight = 2) %>%
  addLayersControl(overlayGroups = c("2017-2018", "2019-2020")) %>%
  addLegend(position = "bottomleft", pal = pallete, values = Buffalo_20$TOTAL.VALUE,
            title = "Single Family Home Value")
Neighborhood_map

Regression Analysis

## Transform Data for Regression
Buffalo_20$log <- log10(Buffalo_20$TOTAL.VALUE)
View(Buffalo_20)

## Multiple Linear Regression
MLR <- lm(log ~ X..OF.BEDS + YEAR.BUILT +
          TOTAL.LIVING.AREA + X..OF.BATHS,
          data = Buffalo_20)
summary(MLR)
## 
## Call:
## lm(formula = log ~ X..OF.BEDS + YEAR.BUILT + TOTAL.LIVING.AREA + 
##     X..OF.BATHS, data = Buffalo_20)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.47352 -0.12522  0.01752  0.15695  1.16285 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       -4.025e+00  9.192e-02  -43.79   <2e-16 ***
## X..OF.BEDS        -4.637e-02  1.735e-03  -26.73   <2e-16 ***
## YEAR.BUILT         4.319e-03  4.723e-05   91.45   <2e-16 ***
## TOTAL.LIVING.AREA  3.385e-04  2.935e-06  115.32   <2e-16 ***
## X..OF.BATHS        5.881e-02  3.328e-03   17.67   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.243 on 37846 degrees of freedom
##   (13 observations deleted due to missingness)
## Multiple R-squared:  0.4773, Adjusted R-squared:  0.4773 
## F-statistic:  8640 on 4 and 37846 DF,  p-value: < 2.2e-16

Conclusions

References

All sources are cited in a consistent manner